﻿/* 
 * TABLE: Televisors 
 */

CREATE TABLE Televisors(
    TelevisorId    int              IDENTITY(1,1),
    Avatar         nvarchar(max)    NOT NULL,
    Name           nvarchar(256)    NOT NULL,
    Diagonal       decimal(3, 1)    NOT NULL,
    Type           int              NOT NULL,
    ReleaseDate    datetime         NULL,
    ThreeD         bit              NOT NULL,
    MagazineId     int              NOT NULL,
    CONSTRAINT PK_Televisors PRIMARY KEY NONCLUSTERED (TelevisorId, MagazineId)
)
GO
/* 
 * TABLE: Televisors 
 */

ALTER TABLE Televisors ADD CONSTRAINT FK_MagazineTelevisors 
    FOREIGN KEY (MagazineId)
    REFERENCES Magazine(MagazineId)